package com.zeltov.api;

import java.util.List;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zeltov.dao.ArtDataDao;
import com.zeltov.eo.ArtData;

@Service("artFacade")
@Transactional(value="hibernate")
public class ArtServiceFacadeImpl implements ArtFacade {

    protected static Logger log =LoggerFactory.getLogger(ArtServiceFacadeImpl.class);

	private ArtDataDao artDataDao;

    @Autowired
    @Qualifier("artDataDao")
	public void setArtDataDao(ArtDataDao artDataDao) {
		this.artDataDao = artDataDao;
	}


    @Override
	@Test
    public void getArt() {
    	
    	log.info("**************************");
        // insert test logic here
    	List<ArtData> allArt = artDataDao.getAll();
    	
    	for (ArtData art : allArt) {
			System.out.println(art);
		}
    	List<ArtData> allArtByQuery = artDataDao.getAllArtByQuery();
    	for (ArtData artData : allArtByQuery) {
			System.out.println(artData);
		}
    }
}
